package com.sudo.common.utils;

import org.apache.commons.codec.binary.Base64;

import java.security.MessageDigest;

public class MD5Util {
    /**
     *
     * @Title: MD5Utils.java
     * @Package com.imooc.utils
     * @Description: 对字符串进行md5加密
     */
    public static String getMD5Str(String strValue) {
        try {
            MessageDigest md5 = MessageDigest.getInstance("MD5");
            return Base64.encodeBase64String(md5.digest(strValue.getBytes()));
        }catch (Exception e){
            throw new RuntimeException("md5加密异常");
        }
    }
}
